import React, { Component, useEffect } from 'react'
import Button from '@material-ui/core/Button';
import "./base.css"
// import {withRouter} from "react-router-dom"
import Nav from "./components/Nav"
import { useHistory } from 'react-router-dom';


export default function App(props) {
  let history = useHistory()

  useEffect(() => {
    if(history.location.pathname === "/") {
      history.push("/home")
    }
  },[])

  return (
    <>
      <>{props.children}</>
      <Nav history= {history} />
    </>
  )

}
 